/**
 * 付款界面
 * author:zhangjlt
 * date:2017年3月16日13:30:42
 */
;
define(function(require, exports, module) {
	var wechat = require("wechat");
	var activityList = {
		data: {},
		/**
		 * bindEvent 页面事件
		 */
		bindEvent: function() {
			//返回
			$("#return_activity").unbind().on("click", function() {
				window.location.href = "#home";
			});
		},
		/**
		 * 进行页面路由监听配置
		 * 
		 */
		bindRout: function() {
			//公共页面监听路由
			Path.map("#home").to(function() {
				//返回首页
				common.loadPage({
					pageUrl: "html/index.html",
					reload: false,
					from: "left"
				});
			});
			Path.listen();
		},
		/**
		 * 页面数据加载
		 */
		initData: function() {
							//iscroll滚动加入
				var iscroll = require("iscroll");
				common.initIscroll({
					container: "iscrollContent_activity",
					showScrollBar: false,
					
				});
//			var _this = this;
//			var param = {};
//			common.loadData({
//				url: "/getactivityListListt",
//				param: param,
//				successCallBack: _this.getactivityListListCallBack, //回调函数
//				dataSource: "getactivityListList"
//			});
			

		},
		//callback function
		getactivityListListCallBack: function(json) {
			console.log("调用后台ajax返回值为：" + JSON.stringify(json));
			if(json.status == "0") {
				activityList.data = json;
				var html2 = template('activityListTemplate', activityList.data);
				document.getElementById('main_activityList').innerHTML = html2;
			} else {
				common.showTip({
					content:json.message
				});
			}

		},
		/**
		 * each page init mothed
		 */
		initialize: function() {
			//动态加载数据
			this.initData();
			//事件绑定
			this.bindEvent();
			//路由绑定
			this.bindRout();
		}
	};

	module.exports =activityList;
});